/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.startup.musicstore.app.factory;

import com.startup.musicstore.model.Album;
import com.startup.musicstore.model.AlbumCategory;
import com.startup.musicstore.model.ArtistInformation;
import com.startup.musicstore.model.Contact;
import com.startup.musicstore.model.CreditCard;
import com.startup.musicstore.model.Customer;
import com.startup.musicstore.model.CustomerAddress;
import com.startup.musicstore.model.Demographic;
import com.startup.musicstore.model.CustomerInvoice;
import com.startup.musicstore.model.MarketingInformation;
import com.startup.musicstore.model.Name;
import com.startup.musicstore.model.OrderItem;
import com.startup.musicstore.model.Orders;
import com.startup.musicstore.model.Review;
import com.startup.musicstore.model.SampleClip;
import com.startup.musicstore.model.Track;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;

/**
 *
 * @author boniface
 */
public class AppFactory {
    
    
    // Create a Credit card with Name, balance, expiry date and credit Number 
     public static CreditCard getCreditCard(Map<String, String> details, BigDecimal balance, Date expiryDate) {
         CreditCard creditCard = new CreditCard();
         creditCard.setCreditNumber(details.get("number"));
         creditCard.setNameOnCreditCard(details.get("name"));
         creditCard.setBalance(balance);
         creditCard.setExpiryDate(expiryDate);
        return creditCard;
    }
     
        public static Customer getCustomer(String custNo, Name name, Contact contact, Demographic demo) {
         Customer customer = new Customer();
         customer.setCustomerNumber(custNo);
         Demographic demo1 = new Demographic();
         demo1.setGender(demo.getGender());
         demo1.setRace(demo.getRace());
         demo1.setDateOfBirth(demo.getDateOfBirth());
         customer.setDemographic(demo1);
         Name name1 = new Name();
         name1.setFirstName(name.getFirstName());
         name1.setLastName(name.getLastName());
         customer.setName(name1);
         Contact cont1 = new Contact();
         cont1.setCellNumber(contact.getCellNumber());
         cont1.setPhoneNumber(contact.getPhoneNumber());
         customer.setContact(cont1);
         
        return customer;
    }
    
   public static CustomerAddress getCustomerAddress(String street, String postal) {
        CustomerAddress customerAddress = new CustomerAddress();
         customerAddress.setPostalAddress(postal);
         customerAddress.setStreetAddress(street);
        return customerAddress;
    }
     
   
    public static Orders getOrders(int orderNumber, Date orderDate) {
        Orders orders = new Orders();
         orders.setOrderNumber(orderNumber);
         orders.setOrderDate(orderDate);
        return orders ;
    }
    
    public static CustomerInvoice getCustomerInvoice(Date invoiceDate, BigDecimal orderAmount, String inStatus) {
        CustomerInvoice customerInvoice = new CustomerInvoice();
         customerInvoice.setInvoiceDate(invoiceDate);
         customerInvoice.setOrderAmount(orderAmount);
         customerInvoice.setInvoiceStatus(inStatus);
        return customerInvoice;
    }

     public static OrderItem getOrderItem(int quantity) {
        OrderItem orderItem = new OrderItem();
         orderItem.setQuantity(quantity);
        return orderItem;
    }
     
    public static Album getAlbum(String albumTitle, BigDecimal unitPrice, int invent, int sales) {
        Album album = new Album();
         album.setAlbumTitle(albumTitle);
         album.setUnitPrice(unitPrice);
         album.setInventory(invent);
         album.setSales(sales);
        return album;
    }
    
     public static Track getTrack(int trackNo, String trackTitle, SampleClip sample) {
        Track track = new Track();
         track.setTrackNumber(trackNo);
         track.setTrackTitle(trackTitle);
         SampleClip clip = new SampleClip();
         clip.setSampleURL(sample.getSampleURL());
         track.setSample(sample);
        return track;
    }
     
      public static AlbumCategory getAlbumCategory(String name) {
        AlbumCategory albumCategory = new AlbumCategory();
         albumCategory.setCategoryName(name);
        return albumCategory;
    }
    
    public static MarketingInformation getMarketingInformation(String status) {
        MarketingInformation marketingInformation = new MarketingInformation();
         marketingInformation.setStatusOfInformation(status);
        return marketingInformation;
    }
    
    public static Review getReview(String desc, int rating) {
        Review review = new Review();
         review.setDescription(desc);
         review.setRating(rating);
        return review;
    }
    
     public static ArtistInformation getArtistInformation(String first, String last) {
        ArtistInformation artistInformation = new ArtistInformation();
         artistInformation.setFirstName(first);
         artistInformation.setLastName(last);
        return artistInformation;
    }
    
}
